package org.seckill.dao;

import org.apache.ibatis.annotations.Param;
import org.seckill.entity.SuccessKilled;

/**
 * Created by lenovo on 2017/7/5.
 */
public interface SuccessKilledDao {

    /**
     * 插入购买明细，通过联合主键可过滤重复
     * @param seckillId
     * @param userPhone
     * @return 插入的行数
     */
    int insertSuccessKilled(@Param("seckillId") Long seckillId,@Param("userPhone") Long userPhone);

    /**
     *根据商品id查询秒杀成功记录，并且携带Seckill对象
     * @param seckillId
     * @return
     */
    SuccessKilled queryByIdWithSeckill(@Param("seckillId") Long seckillId,@Param("userPhone") Long userPhone);

}
